<div class="contenidofijo">
<div class="ciucontracts index">
	<?php  $tokens=array(0=>"", 1=>"Contratos") ?>
        <?php echo $this->element("breadcrumb", array('tokens'=>$tokens))?>
        <?php if(isset($user_list)){ ?>
        <?php 
           foreach($user_list as $key =>$val){
           echo "<div class='button'>";
           echo $this->Html->link(__($val, true), array('action' => 'index', $key));
           echo "</div>";
          }
           ?>
        <?php } ?>
  
        <?php if(isset($user_id)){ ?>
            <div class="button">
            <?php echo $this->Html->link(__('Add', true), array('action' => 'add' , $user_id)); ?>
            </div>
        <?php } ?>
    <!-- form -->
    <div class="ciuusers form">	
      <?php echo $this->Form->create('Ciucontract');?>
      <fieldset>
		    <?php
                    echo $this->Form->input('document');
                ?>
      </fieldset>
      <?php echo $this->Form->end(__('Submit', true));?>
    </div>
    <!-- form -->
    <button>
      <?php echo $this->Html->link(__('New Ciucontract', true), array('action' => 'add')); ?> 
        <br>
    </button>
	<table class="zebra" cellpadding="0" cellspacing="0">
	<thead>
	<tr>
			<th><?php echo $this->Paginator->sort('id');?></th>
			<th><?php echo $this->Paginator->sort('contract_number');?></th>
            <th><?php echo $this->Paginator->sort('document');?></th>
			<th><?php echo $this->Paginator->sort('ciuuser_id');?></th>
			<th><?php echo $this->Paginator->sort('contract_value');?></th>
			<th><?php echo $this->Paginator->sort('start_date');?></th>
			<th><?php echo $this->Paginator->sort('end_date');?></th>
			<th><?php echo $this->Paginator->sort('hours');?></th>
			<th class="actions"><?php __('Actions');?></th>
	</tr>
	</thead>
	<?php
	$i = 0;
	foreach ($ciucontracts as $ciucontract):
		$class = null;
		if ($i++ % 2 == 0) {
			$class = ' class="altrow"';
		}
	?>
	<tr<?php echo $class;?>>
		<td><?php echo $ciucontract['Ciucontract']['id']; ?>&nbsp;</td>
		<td><?php echo $ciucontract['Ciucontract']['contract_number']; ?>&nbsp;</td>
		<td>
               <?php echo $this->Html->link($ciucontract['Ciuuser']['document'], array('controller' => 'ciuusers', 'action' => 'view', $ciucontract['Ciuuser']['id'])); ?>&nbsp;
		</td>
        <td>
	           <?php echo $this->Html->link($ciucontract['Ciuuser']['first_names'], array('controller' => 'ciuusers', 'action' => 'view', $ciucontract['Ciuuser']['id'])); ?>
               <?php echo $ciucontract['Ciuuser']['last_names']; ?>
        </td>
        <td><?php echo $ciucontract['Ciucontract']['contract_value']; ?>&nbsp;</td>
		<td><?php echo $ciucontract['Ciucontract']['start_date']; ?>&nbsp;</td>
		<td><?php echo $ciucontract['Ciucontract']['end_date']; ?>&nbsp;</td>
		<td><?php echo $ciucontract['Ciucontract']['hours']; ?>&nbsp;</td>
		<td class="actions">
			<?php echo $this->Html->link(__('Edit', true), array('action' => 'edit', $ciucontract['Ciucontract']['id'])); ?>
			<?php echo $this->Html->link(__('Delete', true), array('action' => 'delete', $ciucontract['Ciucontract']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $ciucontract['Ciucontract']['id'])); ?>
		</td>
	</tr>
<?php endforeach; ?>
	</table>
	<div class="paginatorcounter">
	<?php
	echo $this->Paginator->counter(array(
	'format' => __('Page %page% of %pages%, showing %current% records out of %count% total, starting on record %start%, ending on %end%', true)
	));
	?>	</p>

	<div class="paging">
		<?php echo $this->Paginator->prev('<< ' . __('previous', true), array(), null, array('class'=>'disabled'));?>
	 | 	<?php echo $this->Paginator->numbers();?>
 |
		<?php echo $this->Paginator->next(__('next', true) . ' >>', array(), null, array('class' => 'disabled'));?>
	</div>
</div>
</div>